package com.woniuxy.controller;


import com.woniuxy.service.RbacManagerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/rbacManager")
public class RbacManagerController {

    @Autowired(required = false)
    RbacManagerService rbacManagerService;

    @RequestMapping("/findOne")
    public Map<String,Object> findOne(int id){
        return rbacManagerService.findOne(id);
    }

    @RequestMapping("/findAll")
    public List<Map<String,Object>> findAll(int id){
        return rbacManagerService.findAll();
    }

    @RequestMapping("/addOne")
    public Integer addOne(@RequestBody Map<String,String> manager){
        return rbacManagerService.Save(manager);

    }
}
